<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>kindeditor</title>
    <!-- 引入文件 -->
    <script charset="utf-8" src="./js/kindeditor/kindeditor-all.js"></script>
    <script charset="utf-8" src="./js/kindeditor/lang/zh-CN.js"></script>
</head>
<body>
    <textarea id="editor_id" name="content" style="width:700px;height:300px;"></textarea>
    <button onclick="getData()">获取内容</button>

    
    <script>
        // 格式化编辑器
        KindEditor.ready(function(K) {
            window.editor = K.create('#editor_id');
        });
        
        // 关闭过滤模式，保留所有标签
        // KindEditor.options.filterMode = false;
        // KindEditor.ready(function(K)){
        //     K.create('#editor_id');
        // }

        // 获取编辑器内容
        function getData(){
            var html = editor.html();
            console.log(html);
            alert(html);
        }
    </script>
</body>
</html>